﻿using System;
using com.yoozoo.gta.Extension.UGUI.ScreenOrientationEx;
using UnityEngine;
using UnityEngine.UI;

namespace com.yoozoo.gta.Extension.UGUI.ScreenOrientation.Adapter
{
    
   
    
    [DisallowMultipleComponent]
    public class VerticalLayoutGroupAdapt: AdaptBase<HorizontalOrVerticalLayoutGroupAdaptConfig, VerticalLayoutGroup>
    {
        public override int Order => (int)AdapterExecuteOrder.ListView;
        protected override void ApplyConfig(HorizontalOrVerticalLayoutGroupAdaptConfig config)
        {
            base.ApplyConfig(config);
            mComponent.childAlignment = config.childAlignment;
            mComponent.padding.left = config.padding.left;
            mComponent.padding.right = config.padding.right;
            mComponent.padding.top = config.padding.top;
            mComponent.padding.bottom = config.padding.bottom;
            mComponent.spacing = config.Spacing;
            mComponent.childAlignment = config.childAlignment;
            mComponent.childControlWidth = config.childControlWidth;
            mComponent.childControlHeight = config.childControlHeight;
            mComponent.childScaleWidth = config.childScaleWidth;
            mComponent.childScaleHeight = config.childScaleHeight;
            mComponent.childForceExpandWidth = config.childForceExpandWidth;
            mComponent.childForceExpandHeight = config.childForceExpandHeight;
            
        }

        protected override void CopyProperty(HorizontalOrVerticalLayoutGroupAdaptConfig config)
        {
            base.CopyProperty(config);
            config.padding = new RectOffset(mComponent.padding.left, mComponent.padding.right, mComponent.padding.top, mComponent.padding.bottom);    
            config.childAlignment = mComponent.childAlignment;
            config.Spacing = mComponent.spacing;
            config.childAlignment = mComponent.childAlignment;
            config.childControlWidth = mComponent.childControlWidth;
            config.childControlHeight = mComponent.childControlHeight;
            config.childScaleWidth = mComponent.childScaleWidth;
            config.childScaleHeight = mComponent.childScaleHeight;
            config.childForceExpandWidth = mComponent.childForceExpandWidth;
            config.childForceExpandHeight = mComponent.childForceExpandHeight;
            
        }
    }

    
}